package cc.lishixi.book.dao.mapper;

import cc.lishixi.book.entity.Reader;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
/*  String readerid;
    String passwd;
    String name;
    String gender;
    String address;
    String tel;
    String startdate;
    String enddate;
    int type;*/
public class ReaderRowMapper implements RowMapper<Reader> {
    @Override
    public Reader mapRow(ResultSet rs, int i) throws SQLException {
        Reader r = new Reader();
        r.setReaderid(rs.getString("readerid"));
        r.setPasswd(rs.getString("passwd"));
        r.setName(rs.getString("name"));
        r.setGender(rs.getString("gender"));
        r.setAddress(rs.getString("address"));
        r.setTel(rs.getString("tel"));
        r.setStartdate(rs.getString("startdate"));
        r.setEnddate(rs.getString("enddate"));
        r.setType(rs.getInt("type"));
        return r;
    }
}
